package com.geek.javase.ch15.work.productionlock;

import java.util.concurrent.TimeUnit;

/*
 *@author wangpeng
 *2025/10/31 20:30
 *@description 生产者
 */
public class Product implements Runnable{

    private House house;

    public Product(House house) {
        this.house = house;
    }

    @Override
    public void run() {
        for (int i = 0; i < 15; i++) {
            house.store();
            try {
                TimeUnit.MILLISECONDS.sleep(200);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
